home *** CD-ROM | disk | FTP | other *** search
/ T&A 2 the Maxx 3 / T and A 2 The Maxx Number 3.iso / viewers / unixview / xgiftar.z / xgiftar / xloadimage.h < prev    next >
C/C++ Source or Header  |  1991-05-20  |  3KB  |  94 lines

  1. /* xloadimage.h:
  2.  *
  3.  * jim frost 06.21.89
  4.  *
  5.  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  6.  * copyright information.
  7.  */
  8.  
  9. #include "copyright.h"
  10. #include <stdio.h>
  11. #include <X11/X.h>
  12. #include <X11/Xlib.h>
  13. #include <X11/Xutil.h>
  14.  
  15. #include "image.h"
  16. #include "options.h"
  17.  
  18. /* image name and option structure used when processing arguments
  19.  */
  20.  
  21. typedef struct {
  22.   char         *name;         /* name of image */
  23.   int           atx, aty;     /* location to load image at */
  24.   unsigned int  bright;       /* brightness multiplier */
  25.   unsigned int  center;       /* true if image is to be centered */
  26.   unsigned int  clipx, clipy; /* area of image to be used */
  27.   unsigned int  clipw, cliph;
  28.   unsigned int  colors;       /* max # of colors to use for this image */
  29.   unsigned int  delay;        /* # of seconds delay before auto pic advance */
  30.   unsigned int  dither;       /* true if image is to be dithered */
  31.   float         gamma;        /* display gamma */
  32.   char         *go_to;        /* label to goto */
  33.   unsigned int  gray;         /* true if image is to be grayed */
  34.   unsigned int  merge;        /* true if we should merge onto previous */
  35.   unsigned int  normalize;    /* true if image is to be normalized */
  36.   int           rotate;          /* # degrees to rotate image */
  37.   unsigned int  smooth;       /* true if image is to be smoothed */
  38.   unsigned int  xzoom, yzoom; /* zoom percentages */
  39.   char         *fg, *bg;      /* foreground/background colors if mono image */
  40. } ImageOptions;
  41.  
  42. /* This struct holds the X-client side bits for a rendered image.
  43.  */
  44.  
  45. typedef struct {
  46.   Display  *disp;       /* destination display */
  47.   int       scrn;       /* destination screen */
  48.   int       depth;      /* depth of drawable we want/have */
  49.   Drawable  drawable;   /* drawable to send image to */
  50.   Pixel     foreground; /* foreground and background pixels for mono images */
  51.   Pixel     background;
  52.   Colormap  cmap;       /* colormap used for image */
  53.   GC        gc;         /* cached gc for sending image */
  54.   XImage   *ximage;     /* ximage structure */
  55. } XImageInfo;
  56.  
  57. #ifndef MAXIMAGES
  58. #define MAXIMAGES BUFSIZ /* max # of images we'll try to load at once */
  59. #endif
  60.  
  61. /* function declarations
  62.  */
  63.  
  64. void supportedImageTypes(); /* imagetypes.c */
  65.  
  66. char *tail(); /* misc.c */
  67. void memoryExhausted();
  68. void internalError();
  69. void version();
  70. void usage();
  71. void goodImage();
  72. Image *processImage();
  73. int errorHandler();
  74.  
  75. char *expandPath(); /* path.c */
  76. int findImage();
  77. void listImages();
  78. void loadPathsAndExts();
  79. void showPath();
  80.  
  81. void imageOnRoot(); /* root.c */
  82.  
  83. void        sendXImage(); /* send.c */
  84. XImageInfo *imageToXImage();
  85. Pixmap      ximageToPixmap();
  86. void        freeXImage();
  87.  
  88. Visual *getBestVisual(); /* visual.c */
  89.  
  90. int   visualClassFromName(); /* window.c */
  91. char *nameOfVisualClass();
  92. void cleanUpWindow();
  93. char imageInWindow();
  94.